package main;

import java.util.logging.Logger;
import org.hibernate.classic.Session;
import entity.*;
import utils.HibernateUtil;

public class Main {
	private static final Logger LOG = Logger.getLogger(Main.class
			.getCanonicalName());

	public static void main(String[] args) {
		Session session = HibernateUtil.getSessionFactory().openSession();
		session.beginTransaction();
		//User(name,password,mail)
		
		User user = new User("my_nickname","my_password","my_email");
		session.save(user);
		
		//Question(QuestionType, questiontext, autoAccepted, acceptedAnswer, poll )
		//session.save(new Question(QuestionType.SIMPLE, "", false, 0, poll));
		
		session.getTransaction().commit();
		LOG.info(session.createQuery("from User").list().toString());
		session.close();
	}
};
